package com.example.dianchiwater;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.DatePicker;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.TimePicker;

public class Shuiwei extends AppCompatActivity {
    LinearLayout ll1,tvXs;
    TextView tvSs;

    ImageView tvXs2;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shuiwei);
        tvXs = findViewById(R.id.tvXs);
        tvSs = findViewById(R.id.tvSs);
        tvXs2=findViewById(R.id.tvXs2);

        tvSs.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                View mView = View.inflate(Shuiwei.this,R.layout.activity_sousuo,null);



                new AlertDialog.Builder(Shuiwei.this)
                        .setTitle("搜素水位信息")
                        .setView(mView)
                        .setPositiveButton("搜索", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {

                            }
                        })
                        .setNegativeButton("取消",null)
                        .show();
            }
        });
        tvXs.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ll1 = findViewById(R.id.ll1);
                if(ll1.getVisibility()==View.GONE) {
                    ll1.setVisibility(View.VISIBLE);
                    tvXs2.setImageResource(R.drawable.down);
                }
                else {
                ll1.setVisibility(View.GONE);
                    tvXs2.setImageResource(R.drawable.left);
                }
            }
        });
    }
}